//
//  JRDMeTableAccountCell.m
//  v2ex-iOS
//
//  Created by dhcui on 16/5/21.
//  Copyright © 2016年 Singro. All rights reserved.
//

#import "JRDMeTableAccountCell.h"
#import "JrdCommon.h"
#import "JrdAccountModel.h"
@interface  JRDMeTableAccountCell()

@end
@implementation JRDMeTableAccountCell


-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self){
        self.backgroundColor = JrdNavigationBarColor;
        [self initViews];
    }
    
    return self;
}

- (void)initViews{
    //Account imageView and Account Username
    self._imageView = [[UIImageView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - 80)/2, (10), 80, 80)];
    /*self._imageView.layer.masksToBounds = YES;
    self._imageView.layer.cornerRadius = self.imageView.bounds.size.width*0.5;
    self._imageView.layer.borderWidth=1.0;
    self._imageView.layer.borderColor = JRD_RGB(240,240,240).CGColor;
    self._imageView.backgroundColor = [UIColor whiteColor];*/
    self._imageView.contentMode = UIViewContentModeScaleAspectFill;
    self._imageView.clipsToBounds = YES;
    self._imageView.layer.cornerRadius = 5; //kAvatarHeight / 2.0;
    self._imageView.layer.borderColor = RGB(0x8a8a8a, 1.0).CGColor;
    self._imageView.layer.borderWidth = 1.0f;

    [self addSubview:self._imageView];
    
    self._labelView = [[UILabel alloc] initWithFrame:CGRectMake(10, 100, (SCREEN_WIDTH - 20), 30)];
    self._labelView.textAlignment = NSTextAlignmentCenter;
    [self._labelView setFont:[UIFont fontWithName:@"kailasa" size:18]];
    [self addSubview:self._labelView];
    
}

- (void)setAccountInfo:(JrdAccountModel*)account{
    self._imageView.image = account.LocalImage_ext;//[UIImage imageNamed:account.LocalImage];//[[UIImage alloc] ];
    self._labelView.text = account.userName;
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
